<?php 
namespace Api\Abstracte;

abstract class Controller extends \CI_Controller implements \Api\Interfaces\IControllerAdapter
{

    protected $model;

    protected $api;
    protected $input;

    public function __construct()
    {
        parent::__construct();
        //$this->api = new \Api\Api();
        //$this->input = $this->api->input();
    }

    public function get()
    {
        $result = $this->model->detail($this->input);
        \Api\Api::output($result);
    }

    public function lists()
    {
        $input = \Api\Api::input();
        $result = $this->model->lists($input);
        \Api\Api::output($result);
    }

    public function save()
    {
        $input = \Api\Api::input();
        $result = $this->model->save($input);
        \Api\Api::output($result);
    }

    public function remove()
    {
        $input = \Api\Api::input();
        $result = $this->model->remove($input);
        \Api\Api::output($result);
    }
}